package edu.famework.demo6;

import java.util.*;

public class Remove2 {
//    2.有十万个数据，去除掉所有重复的数据
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        Random r = new Random();
        for (int i = 0; i < 100000; i++) {
            int x = r.nextInt(100000);
            list.add(x);
        }
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < list.size(); i++) {
            set.add(list.get(i));
        }
        System.out.println(set);


    }

}
